﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Peer.Web.UI
{
    public class PeerPage:System.Web.UI.Page
    {
        protected string LastPage
        {
            set
            {
                ViewState["LastPage"] = value;
            }
            get
            {
                return ViewState["LastPage"] as string;
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            if (!IsPostBack)
            {
                Uri url=Request.UrlReferrer as Uri;
                if(url!=null)
                {
                    LastPage = url.ToString();
                }
            }
            base.OnLoad(e);
        }
        protected void GoBack()
        {
            if (!string.IsNullOrEmpty(LastPage))
            {
                Response.Redirect(LastPage);
            }
        }
    }
}
